package com.jjq;

public class Phone implements Comparable<Phone>{
    private String phone;
    private Integer number;
    private Double money;

    public Phone() {
    }
    public Phone(String phone, Integer number, Double money) {
        this.phone = phone;
        this.number = number;
        this.money = money;
    }


    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public Integer getNumber() {
        return number;
    }

    public void setNumber(Integer number) {
        this.number = number;
    }

    public Double getMoney() {
        return money;
    }

    public void setMoney(Double money) {
        this.money = money;
    }

    @Override
    public String toString() {
        return "Phone{" +
                "phone='" + phone + '\'' +
                ", number=" + number +
                ", money=" + money +
                '}';
    }

    @Override
    public int compareTo(Phone o) {
        return money > o.money ? -1 : 1;
    }
}
